<?php
if (!empty($_POST['url']) OR empty($_POST['name'])) {
	
	 echo 'No spammers allowed';
	 exit();
	
} else {


	$email = "enquiry@FXM2U.com"; 
	$msg  = "FXM2U\n";
	$msg .= "======================================\n";
	$msg .= "Submitted by ".$_POST['Name'].' on '.date("d-M-Y H:m")."\n\n"; 
	$msg .= "First Name       : \t".$_POST['name']."\n"; 
	$msg .= "email       : \t".$_POST['email']."\n"; 
	$msg .= "======================================\n";
	$msg .= "Telephone           : \t".$_POST['telephone']."\n";
    $msg .= "======================================\n";
    $msg .= "message         : \t".$_POST['message']."\n";
	$msg .= "======================================\n";
	$msg .= "* Thank you, your submission has been received. Our staff will attend to this shortly \n";
	
	$headers = "From: ".$_POST['Name']." <".$_POST['email'].">"; 

	if(mail($email, "FXM2U", $msg, $headers)){
		mail("wanhanfei@gmail.com", "FXM2U", $msg, $headers);
		echo "<script>alert('Thank you for feedback. We shall revert to you the soonest possible.'); location='contact.html'; </script>";
	}else{
		echo "<script>alert('Message send failed. Please try again or contact us if this happen again. '); location='contact-us.html'; </script>"; 
	}
/*
	if (isset($_POST['form1']) and $_POST['form1']=='yes')
{	
	$email = 'admin@pointsavenue.com.my';
	
  if (mail( $email, "T-Connect Sdn Bhd",
        "T-Connect Sdn Bhd\n".
        "----------------------------------\n".
        "Info below was submitted by ".$_POST['fame'].' on '.date("d-M-Y H:m")."\n\n".
        "    [Name] \t".$_POST['Name']."\n".
        " [Company] \t".$_POST['Company']."\n".
		" [Adrress] \t".$_POST['Company']."\n".
        "   [Email] \t".$_POST['Email']."\n".
        "   [Phone] \t".$_POST['Phone']."\n".
        " [Message] \t".$_POST['Message']."\n", "From: ".$_POST['Name']." <".$_POST['Email'].">"))
    {
			echo '<script>alert("Thank you for inquiry/feedback. We shall revert to you the soonest possible.");location="contact-us.html"</script>';
    }
} else { sleep(100); die; }
*/
}
?>	